package eBrain.beans;

import java.sql.Timestamp;
import java.util.Date;

public class Bid {
	
	private int itemId;
	private int userId;
	private double bidValue;
	private Timestamp timestamp;
	private int ratUserId;
	private int ratingId;
	public int getItemId() {
		return itemId;
	}
	public void setItemId(int itemId) {
		this.itemId = itemId;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public double getBidValue() {
		return bidValue;
	}
	public void setBidValue(double bidValue) {
		this.bidValue = bidValue;
	}
	public Timestamp getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}
	public int getRatUserId() {
		return ratUserId;
	}
	public void setRatUserId(int ratUserId) {
		this.ratUserId = ratUserId;
	}
	public int getRatingId() {
		return ratingId;
	}
	public void setRatingId(int ratingId) {
		this.ratingId = ratingId;
	}
	
	public boolean isEmpty(){
		if(itemId == 0 ){
			return true;
		}
		else {
			return false;
		}
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(bidValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + itemId;
		result = prime * result + ratUserId;
		result = prime * result + ratingId;
		result = prime * result
				+ ((timestamp == null) ? 0 : timestamp.hashCode());
		result = prime * result + userId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bid other = (Bid) obj;
		if (Double.doubleToLongBits(bidValue) != Double
				.doubleToLongBits(other.bidValue))
			return false;
		if (itemId != other.itemId)
			return false;
		if (ratUserId != other.ratUserId)
			return false;
		if (ratingId != other.ratingId)
			return false;
		if (timestamp == null) {
			if (other.timestamp != null)
				return false;
		} else if (!timestamp.equals(other.timestamp))
			return false;
		if (userId != other.userId)
			return false;
		return true;
	}
	
}